<?php
class Dmdformtype extends AppModel {
	var $name = 'Dmdformtype';
	var $displayField = 'title';
	//The Associations below have been created with all possible keys, those that are not needed can be removed
var $virtualFields=array(
            'display'=>'CONCAT(Dmdformtype.title)'
        );
	var $hasMany = array(
		'Dmdform' => array(
			'className' => 'Dmdform',
			'foreignKey' => 'dmdformtype_id',
			'dependent' => false,
		),
		'Module' => array(
			'className' => 'Module',
			'foreignKey' => 'dmdformtype_id',
			'dependent' => false,
		)
	);

        function getModulesForDmdformType($idType=null){
            if($idType){
                return $this->Module->getModulesForDmdformType($idType);
            }else{
                return false;
            }
        }
        function getModulesGetActionsForDmdformType($idType=null){
            if($idType){
                return $this->Module->getModulesGetActionsForDmdformType($idType);
            }else{
                return false;
            }
        }
        function getModulesValidationForDmdformType($idType=null){
            if($idType){
                return $this->Module->getModulesValidationForDmdformType($idType);
            }else{
                return false;
            }
        }
        function getModuleTitleNames($idType=null){
            if($idType){
                return $this->Module->getModuleTitleNames($idType);
            }else{
                return false;
            }
        }

        function getTitle($idType=null){
            if($idType){
                $type= $this->find('list',array(
                    'conditions'=>array(
                        'id'=>$idType
                    ),
                    'fields'=>array('code')
                ));
                return $type[$idType];
            }else{
                return false;
            }
        }
        function getName($idType){
             if($idType){
                $type= $this->find('list',array(
                    'conditions'=>array(
                        'id'=>$idType
                    ),
                    'fields'=>array('title')
                ));
                return $type[$idType];
            }else{
                return false;
            }
        }
        function getTypes(){
            return $this->find('list');
        }
}
?>